package miharu.twit;


import twitter4j.Twitter;
import twitter4j.TwitterException;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;


import java.io.IOException;




public class PostServlet extends HttpServlet {
    private static final long serialVersionUID = 2132731135996613711L;

	/** 定型文 */
	private static final String TEXT = "ふぅ・・・  ＞  ";

	/** ハッシュタグ */
	private static final String HASH_TAG = "#twitmasturbation";

    protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {

    	request.setCharacterEncoding("UTF-8");
        Twitter twitter = (Twitter)request.getSession().getAttribute("twitter");
        try {



            twitter.updateStatus("test");

        } catch (TwitterException e) {
            throw new ServletException(e);
        }
        response.sendRedirect(request.getContextPath()+ "/");
    }
}
